
import FormTableFormulaLang from   "@/locales/lang/impl/form/FormTableFormulaLang.js"

import {I18Parse} from "@lowcode/jpaas-common-lib";

let i18n  =function (langKey,text) {
    return I18Parse.getI18Val(FormTableFormulaLang.formTableFormula,langKey, text)
}


let contextAndOperator=[
    {
        name:i18n("formula.flowOperation","流程(操作)"),
        items:[
            {name:i18n("formula.flow","流程(模式)") ,value:"mode.equals('flow')"},
            {name:i18n("formula.draft", "草稿(启动)"),value:"op.equals('draft')"},
            {name:i18n("formula.startFlow", "启动流程"),value:"op.equals('start')"},
            {name:i18n("formula.saveTask", "保存(任务)"),value:"op.equals('save')"},
            {name:i18n("formula.approve", "审批(任务)") ,value:"op.equals('approve')"},
            {name:i18n("formula.AGREE", "通过(意见)")  ,value:"opinion.equals('AGREE')"},
            {name:i18n("formula.ABSTAIN", "弃权(意见)") ,value:"opinion.equals('ABSTAIN')"},
            {name:i18n("formula.REFUSE", "反对(意见)") ,value:"opinion.equals('REFUSE')"},
            {name:i18n("formula.BACK", "驳回"),value:"opinion.equals('BACK')"},
            {name:i18n("formula.BACKSPEC", "驳回指定节点"),value:"opinion.equals('BACK_SPEC')"},
            {name:i18n("formula.BACK_TO_STARTOR", "驳回发起人"),value:"opinion.equals('BACK_TO_STARTOR')"},
        ]
    },
    {
        name:i18n("formula.formOp","表单方案"),
        items:[
            {name:i18n("formula.oForm","表单(模式)"),value:"mode.equals('form')"},
            {name:i18n("formula.formSave","保存") ,value:"op.equals('save')"},
            {name:i18n("formula.formStart","启动流程"),value:"op.equals('start')"},
        ]
    },
    {
        name:i18n("context.context","上下文"),
        items:[
            {name:i18n("context.mainKey","主表主键"),value:"mainCur.ID_"},
            {name:i18n("context.mainCur","主表记录"),value:"mainCur."},
            {name:i18n("context.mainOld","主表原记录"),value:"mainOld."},
            {name:i18n("context.curKey","当前主键"),value:"cur.ID_"},
            {name:i18n("context.cur","当前记录"),value:"cur."},
            {name:i18n("context.old","原记录"),value:"old."}
        ]
    },
    {
        name:i18n("formula.origin","源数据操作"),
        items:[
            {name:i18n("formula.new","新增"),value:"action.equals('new')"},
            {name:i18n("formula.update","更新"),value:"action.equals('upd')"},
            {name:i18n("formula.del","删除"),value:"action.equals('del')"},
        ]
    },
    {
        name:i18n("symbol.operator","运算符"),
        items:[
            {name:i18n("symbol.plus","加"),value:"+"},
            {name:i18n("symbol.minus","减"),value:"-"},
            {name:i18n("symbol.multiply","乘"),value:"*"},
            {name:i18n("symbol.divide","除"),value:"/"},
            {name:i18n("symbol.negation","取反"),value:"!"},
            {name:i18n("symbol.and","与"),value:"&&"},
            {name:i18n("symbol.or","或"),value:"||"},
            {name:"==",value:"=="},
            {name:i18n("symbol.equal","相等"),value:".equals()"},
            {name:"IN",value:"util.in('','','')"},
            {name:i18n("symbol.exist","存在"),value:"util.isExist('表名','字段名','值')"},
            {name:i18n("symbol.existDb","存在(数据源)"),value:"util.isExist('数据源','表名','字段名','值')"},
            {name:i18n("symbol.getValue","获取value"),value:"util.getValue('')"},
            {name:i18n("symbol.getLabel","获取label"),value:"util.getLabel('')"},
        ]
    }
];

export  default contextAndOperator;